<?php
class Move implements SplObserver {
	private $info;
	public function update(SplSubject $obj){
		$this->info = $info =$obj->getParams();
		if(method_exists(__CLASS__,$info['act'])){
			$this->$info['act']($obj);
		}
	}
	
	/*
	*	News数据转移
	*/
	public function move(){
		$id    = $this->_get('id');
		$model = $this->_get('model');
		$cid = $this->_get('cid');
		if(empty($id)||empty($model)||empty($cid)){
			$this->error('缺少参数!');
			return false;
		}
		$data['cid'] = $cid;
		$obj = M($model);
		$res = $obj->where('id in('.$id.')')->save($data);
		if($res){
			$this->success('转移成功');
		}else{
			$this->error($obj->getError());
		}
	}

}